﻿

using System.Data;
using System.Data.SqlClient;
using System;
using FrameWork.Utility;
using InventoryProject.Framework.Entity;


namespace InventoryProject.FrameWork
{
    public class UserAccess
    {        
        public DataTable CheckLogin(string user, string pass)
        {
            SqlParameter[] param = new SqlParameter[2];
            param[0] = new SqlParameter("@pUser",user);
            param[1] = new SqlParameter("@pPass",pass);
            return DBHelper.getDataTable_SP("sp_CheckLogin", param);
        }
        public DataTable UserInfo_Save(string SType, UserEntity _entity, string LoginID)
        {
            SqlParameter[] param = new SqlParameter[6];
            param[0] = new SqlParameter("@pType", SType);
            param[1] = new SqlParameter("@pUserID",_entity.UserID);
	        param[2] = new SqlParameter("@pUserNm",_entity.Username);
	        param[3] = new SqlParameter("@pDisplayNm",_entity.DisplayName);
	        param[4] = new SqlParameter("@pPassword",_entity.Password);
            param[5] = new SqlParameter("@pLoginID", LoginID);
            return DBHelper.getDataTable_SP("sp_UserInfo_Save", param);
        }
        public DataTable UserList_Qry(string UserID)
        {
            SqlParameter[] param = new SqlParameter[1];
            param[0] = new SqlParameter("@pUserID", UserID);
            return DBHelper.getDataTable_SP("sp_UserList_Qry", param);
        }
    }
}